#!/bin/bash
set -e
cd "$(dirname "$0")"

source venv/bin/activate

python3 convert_txt_to_csv.py
python3 two_tackle.py
python3 user_tackle.py
mv user_new.csv user_v.csv
mv call_new.csv call_edges.csv
rm -rf ../fianl_answer
mkdir ../fianl_answer
mv user_v.csv ../fianl_answer/
mv call_edges.csv ../fianl_answer/
cp ../filter_data_csv/100/user.csv ../fianl_answer/
cp ../filter_data_csv/100/tv.csv ../fianl_answer/
python3 convert_to_bigint.py
cp ../filter_data_csv/100/user.csv ../fianl_answer/converted_bigint/user_t.csv
gsql -d antifraud_test -f clean.sql
gsql -d antifraud_test -f load.sql
